<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{
 
	$incomingRegister = array();
  $msg                = "No Record Found";
  
  echo $selectincomingRegister = "SELECT pmmaster.newPartyName,DATE_FORMAT(incoming.IncomingDate,'%d-%m-%Y')AS IncomingDate,planning.quantity,incoming.challan,planning.weight,
                                    material.materialName,process.processName,logsheet.startTime,logsheet.startTime,logsheet.soakingStartTime,logsheet.endTime
	                             FROM pmmaster
	                             JOIN incoming ON incoming.incomingId = pmmaster.incomingId
	                             JOIN process ON process.processId = pmmaster.processId
	                             JOIN material ON material.materialId = pmmaster.materialId
	                             JOIN logsheet ON logsheet.logSheetId = pmmaster.logSheetId
	                             JOIN planning ON planning.planningId = pmmaster.planningId
	                            WHERE incoming.incomingId = ".$_GET['incomingId'];
	$selectincomingRegisterRes = mysql_query($selectincomingRegister);
	if($incomingRow = mysql_fetch_array($selectincomingRegisterRes))
	{
		$incomingRegister['newPartyName'] = $incomingRow['newPartyName'];
		$incomingRegister['IncomingDate'] = $incomingRow['IncomingDate'];
		$incomingRegister['quantity']     = $incomingRow['quantity'];
		$incomingRegister['challan']      = $incomingRow['challan'];
		$incomingRegister['weight']       = $incomingRow['weight'];
	}

  include("./bottom.php");
  $smarty->assign("msg",$msg);
  $smarty->assign("incomingRegister",$incomingRegister);
	$smarty->display('incomingRegisterPrint.tpl');
}
?>